package com.tsll.controller;

import com.tsll.entity.Department;
import com.tsll.service.DepartmentService;
import com.tsll.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/dept")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    @Autowired
    private HttpSession session;

    @GetMapping("/insert")
    public Result getDepartmentById(@PathVariable Integer id) {
        return departmentService.selectByPrimaryKey(id);
    }

    @GetMapping("/selectDepts")
    public Result selectAll(){
        return departmentService.selectAll();
    }
}
